package com.coursehub.shared.exception;

/**
 * 服务调用异常
 */
public class ServiceCallException extends RuntimeException {
    
    private final String serviceName;
    
    public ServiceCallException(String serviceName, String message) {
        super(message);
        this.serviceName = serviceName;
    }
    
    public ServiceCallException(String serviceName, String message, Throwable cause) {
        super(message, cause);
        this.serviceName = serviceName;
    }
    
    public String getServiceName() {
        return serviceName;
    }
    
    @Override
    public String getMessage() {
        return String.format("Service '%s' call failed: %s", serviceName, super.getMessage());
    }
}